from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import (
    StockBasicViewSet,
    TradeDateViewSet,
    DailyDataViewSet,
    DailyBasicViewSet,
    TushareDataUpdateViewSet,
    ThsPlateViewSet,
    ThsStockPlateViewSet,
    LastUpdatedDateView
)

# 创建路由器并注册视图集
router = DefaultRouter()
router.register(r'stock-basic', StockBasicViewSet)
router.register(r'trade-cal', TradeDateViewSet)
router.register(r'daily', DailyDataViewSet)
router.register(r'daily-basic', DailyBasicViewSet)
router.register(r'data-update', TushareDataUpdateViewSet, basename='data-update')
router.register(r'ths-plate', ThsPlateViewSet)
router.register(r'ths-stock-plate', ThsStockPlateViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('last-updated-date', LastUpdatedDateView.as_view(), name='last-updated-date'),
]